package com.ds.spb.controller;

import com.ds.spb.exception.MyException;
import com.ds.spb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TestController {

    @Autowired
    private UserService userService;

    @RequestMapping("/test")
    @ExceptionHandler(MyException.class)
    public List<Map<String,Object>> test(){
        return userService.getAllUser();
    }
}
